package com.pureut.storage.scheduling;

import com.pureut.common.redis.service.RedisService;
import com.pureut.storage.utils.VariousKeyEnum;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/***
 * 批次号定时任务清理缓存
 * Author:C
 * Date:2022/12/27 11:30
 * @DESC
 */
@Component
public class StorgeScheduling {

    @Resource
    RedisService redisService;

    /**
     * 删除批次号的缓存
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void cleanCache() {
        redisService.deleteObject(VariousKeyEnum.getValue(1));
    }
}
